#ifndef DW_GRAPHICS_OPENGL_TEXTURE_H
#	define DW_GRAPHICS_OPENGL_TEXTURE_H

#include "graphics/texture.h"

namespace dw
{
	namespace graphics
	{
		namespace opengl
		{
			class Texture : public ITexture
			{	
			public:

				Texture();

				Texture(const Type& type, const PixelFormat& pixelFormat, const unsigned width, const unsigned height, const Usage& usage);
				
				~Texture();



				void load(std::istream& is);

				void unload();



				virtual void resize(const uint32 size);
				
				virtual void resize(const unsigned mipmap, const uint32 size);
				
				virtual void lock(const uint32 offset, const uint32 size, const Access access);
				
				virtual void unlock();
				
				virtual void read(const uint32 offset, const uint32 size, void* dst) const ;
				
				virtual void write(const uint32 offset, const uint32 size, const void* src);
				
				virtual void write(const unsigned mipmap, const uint32 offset, const uint32 size, const void* src);
				
				virtual void dispose();



				//uint32 getWidth() const ;

				//uint32 getHeight() const ;

				//uint32 getDepth() const ;



				uint32 glId() const { return _glId; }

				uint32 glType() const ;

				uint32 glFormat() const ;

				uint32 glInternalFormat() const ;

				uint32 glDataType() const ;

			private:

				uint32 _glId;

			};
		}
	}
}

#endif